package tw.edu.tku.im.maze;

import org.json.JSONException;
import org.json.JSONObject;

public class ChangeTeamReq extends ReqPacket {

   int roomID;
   String userID;
   int ticket;
   
   //-------------------------------------------------------
   public ChangeTeamReq(int roomID, String userID, int ticket) {
      this.roomID = roomID;
      this.userID = userID;
      this.ticket = ticket;
   }
   
   //-------------------------------------------------------
   public int getRoomID() {
      return this.roomID;
   }
   public void setRoomID(int roomID) {
      this.roomID = roomID;
   }
   
   //-------------------------------------------------------
   public String getUserID() {
      return this.userID;
   }
   public void setUserID(String userID) {
      this.userID = userID;
   }
   
   //-------------------------------------------------------
   public int getTicket() {
      return this.ticket;
   }
   public void setTicket(int ticket) {
      this.ticket = ticket;
   }
   
   //-------------------------------------------------------
   public String toJSONString() throws JSONException {
      JSONObject parameter = new JSONObject();
      parameter.put("roomID", this.roomID);
      parameter.put("userID", this.userID);
      parameter.put("ticket", this.ticket);
      JSONObject jsonObj = new JSONObject();
      jsonObj.put("parameter", parameter);
      jsonObj.put("action", "changeTeam");
      return jsonObj.toString();
   }

   @Override
   public String getPacketName() {
      return "changeTeam";
   }

}
